import {getpubkey} from '@/api/key';
import { Toast } from 'vant';

const state = {
  pubKey:'',
  TabbarData:[
    {
      path:'/MixinList',
      title:'主页',
      icon:'home-o',
      toicon:'wap-home',
      badge:'',
      activeColor:'#1989fa',
      deactiveColor:'#7d7e80'
    },
    {
      path:'/more',
      title:'更多',
      icon:'like-o',
      toicon:'like',
      badge:'',
      activeColor:'#1989fa',
      deactiveColor:'#7d7e80'
    },
    {
      path:'/map',
      title:'地图',
      icon:'location-o',
      toicon:'location',
      badge:'',
      activeColor:'#1989fa',
      deactiveColor:'#7d7e80'
    },
    {
      path:'/user',
      title:'我的',
      icon:'friends-o',
      toicon:'friends',
      badge:'',
      activeColor:'#1989fa',
      deactiveColor:'#7d7e80'
    }
  ]
}

const actions = {
  pubKey({state}){
    getpubkey().then(data=>{
      state.pubKey = data.data;
    }).catch(err=>{
      Toast.fail(err);
    })
  }
}

const mutations={

}

export default{
  namespaced: true,
  state,
  mutations,
  actions
}